package com.graduation.springbootinit.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.graduation.springbootinit.model.entity.ActivityPart.QuizChallenge;
import com.graduation.springbootinit.model.entity.ActivityPart.QuizQuestion;
import com.graduation.springbootinit.model.entity.ActivityPart.QuizRecord;
import com.graduation.springbootinit.model.vo.QuizQuestionVO;
import com.graduation.springbootinit.model.request.QuizSubmitRequest;

import java.util.List;
import java.util.Map;

public interface QuizChallengeService extends IService<QuizChallenge> {
    
    /**
     * 创建答题挑战
     */
    void createChallenge(QuizChallenge challenge);
    
    /**
     * 添加题目
     */
    void addQuestion(QuizQuestion question);
    
    /**
     * 获取挑战的所有题目(不含答案)
     */
    List<QuizQuestionVO> getChallengeQuestions(Long challengeId);
    
    /**
     * 提交答题
     */
    QuizRecord submitAnswers(Long userId, Long challengeId, List<QuizSubmitRequest.AnswerRecord> answers);
    
    /**
     * 获取进行中的挑战
     */
    Page<QuizChallenge> getOngoingChallenges(int pageNum, int pageSize);
    
    /**
     * 结束挑战并发放奖励
     */
    void endChallengeAndReward(Long challengeId);
    
    /**
     * 获取用户的答题历史
     */
    List<QuizRecord> getUserQuizHistory(Long userId);
    
    /**
     * 获取挑战统计信息
     */
    Map<String, Object> getChallengeStats(Long challengeId);
    
    /**
     * 批量添加题目
     */
    void addQuestionBatch(Long challengeId, List<QuizQuestion> questions);
} 